package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.AssembleRequest;
import one.stand.request.GoodsAssembleRequest;
import one.stand.response.AssembleResponse;
import one.stand.response.GoodsAssembleResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 拼团管理
 * @author Administrator
 */
@RestController
@RequestMapping("/assemble")
public class AssembleController extends BaseController {

    /**
     * 添加拼团配置
     */
    @PostMapping("insertGoodsAssemble")
    public ResultModel<Boolean> insertGoodsAssemble(@RequestBody GoodsAssembleRequest request){
        return assembleService.insertGoodsAssemble(request);
    }

    /**
     * 拼团商品草稿箱列表
     */
    @PostMapping("selectGoodsAssembleDraftsPage")
    public ResultModel<List<GoodsAssembleResponse>> selectGoodsAssembleDraftsPage(@RequestBody GoodsAssembleRequest request){
        return assembleService.selectGoodsAssembleDraftsPage(request);
    }

    /**
     * 拼团数据删除
     */
    @PostMapping("delGoodsAssembleInfo")
    public ResultModel<Boolean> delGoodsAssembleInfo(@RequestBody GoodsAssembleRequest request){
        return assembleService.delGoodsAssembleInfo(request);
    }

    /**
     * 发布拼团配置
     */
    @PostMapping("releaseGoodsAssemble")
    public ResultModel<Boolean> releaseGoodsAssemble(@RequestBody GoodsAssembleRequest request){
        return assembleService.releaseGoodsAssemble(request);
    }

    /**
     * 拼团列表
     */
    @PostMapping("selectGoodsAssemblePage")
    public ResultModel<List<AssembleResponse>> selectGoodsAssemblePage(@RequestBody AssembleRequest request){
        return assembleService.selectGoodsAssemblePage(request);
    }

    /**
     * 拼团详情
     */
    @PostMapping("getGoodsAssembleInfo")
    public ResultModel<AssembleResponse> getGoodsAssembleInfo(@RequestBody AssembleRequest request){
        return assembleService.getGoodsAssembleInfo(request);
    }
}
